-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use Event#from_json if available #21
use Event#from_json if available #21
Conversation
looks good, have the same concern about testing as mentioned here: logstash-plugins/logstash-codec-json_lines#19 (comment) |
@talevy I used the same strategy as json_lines, let me know if all good. |
|
||
def from_json_parse(json, &block) | ||
LogStash::Event.from_json(json).each { |event| yield event } | ||
rescue LogStash::Json::ParserError => e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why no begin
block? I prefer the indentation that we get by using the begin, but I also understand it is a bit redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, its a style preference, I actually like no having the extra indentation of the begin! 😉
small comment, ott LGTM |
thanks, squashing, bumping and merging. |
run specs for both Event#from_json or legacy context if possible
0e15801
to
52baa87
Compare
published 2.1.0 |
relates to https://github.com/elastic/logstash/pull/4631and elastic/logstash#4595
similar PR as logstash-plugins/logstash-codec-json_lines/pull/19 to support the new
Event#from_json
if available when using the Java Event.